--[[ 编码: WMS-21-22 名称: 入库单明细-新增小窗口-选物料后 作者:HAN 日期:2025-1-29 级别:固定 (说明本段代码在项目中不太会变化) 函数: AfterSelectItem 功能: 在货品查询面板中选中一个货品后 更改记录: --]] wms_base = require ("wms_base") function AfterSelectItem ( strLuaDEID ) local nRet, strRetInfo, select_dataobj local data_json nRet, data_json = m3.GetSysDataJson( strLuaDEID ) if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), data_json ) end local nCount = #data_json if ( 0 == nCount ) then mobox.setInfo( strLuaDEID, "请先选中一个商品!" ) return end local obj_attrs = m3.KeyValueAttrsToObjAttr( data_json[1].attrs ) if ( volume == 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "选中的物料体积为0! " ) end local action = { { action_type = "set_dlg_attr", value = { { attr = "S_ITEM_CODE", value = obj_attrs.S_ITEM_CODE }, { attr = "S_ITEM_NAME", value = obj_attrs.S_ITEM_NAME }, { attr = "S_CELL_TYPE", value = obj_attrs.S_CELL_TYPE }, { attr = "F_VOLUME", value = lua.StrToNumber( obj_attrs.F_VOLUME ) }, { attr = "F_WEIGHT", value = lua.StrToNumber( obj_attrs.F_WEIGHT ) } } } } nRet, strRetInfo = mobox.setAction( strLuaDEID, lua.table2str(action) ) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction失败! "..strRetInfo..' action = '..strAction ) end end